package com.google.code.jskills.dal.entities;

// Generated 25.06.2013 17:52:09 by Hibernate Tools 3.6.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * UserEntity generated by hbm2java
 */
@Entity
@Table(name = "USER_", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = {
		@UniqueConstraint(columnNames = "EMAIL"),
		@UniqueConstraint(columnNames = "MOBILE") })
public class UserEntity implements java.io.Serializable {

	private Integer id;
	private CountryEntity countryEntity;
	private UserVerificationEntity userVerificationEntity;
	private String firstName;
	private String lastName;
	private String email;
	private String password;
	private String secretQuestion;
	private String secretAnswer;
	private String mobile;
	private Boolean sex;
	private int age;
	private Date registrationDate;
	private boolean isBlocked;
	private boolean isDeleted;
	private boolean isVerified;
	private Set<UserUuidEntity> userUuidEntities = new HashSet<UserUuidEntity>(
			0);
	private Set<UserRoleEntity> userRoleEntities = new HashSet<UserRoleEntity>(
			0);

	private Set<UserGroupEntity> userGroupEntities = new HashSet<UserGroupEntity>(
			0);

	public UserEntity() {
	}

	public UserEntity(CountryEntity countryEntity, String firstName,
			String lastName, String email, String password,
			String secretQuestion, String secretAnswer, String mobile, int age,
			boolean isBlocked, boolean isDeleted, boolean isVerified) {
		this.countryEntity = countryEntity;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.password = password;
		this.secretQuestion = secretQuestion;
		this.secretAnswer = secretAnswer;
		this.mobile = mobile;
		this.age = age;
		this.isBlocked = isBlocked;
		this.isDeleted = isDeleted;
		this.isVerified = isVerified;
	}

	public UserEntity(CountryEntity countryEntity, String firstName,
			String lastName, String email, String password,
			String secretQuestion, String secretAnswer, String mobile,
			Boolean sex, int age, Date registrationDate, boolean isBlocked,
			boolean isDeleted, boolean isVerified,
			Set<UserUuidEntity> userUuidEntities,
			Set<UserRoleEntity> userRoleEntities,
			UserVerificationEntity userVerificationEntity,
			Set<UserGroupEntity> userGroupEntities) {
		this.countryEntity = countryEntity;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.password = password;
		this.secretQuestion = secretQuestion;
		this.secretAnswer = secretAnswer;
		this.mobile = mobile;
		this.sex = sex;
		this.age = age;
		this.registrationDate = registrationDate;
		this.isBlocked = isBlocked;
		this.isDeleted = isDeleted;
		this.isVerified = isVerified;
		this.userUuidEntities = userUuidEntities;
		this.userRoleEntities = userRoleEntities;
		this.userVerificationEntity = userVerificationEntity;
		this.userGroupEntities = userGroupEntities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "COUNTRY_ID", nullable = false)
	public CountryEntity getCountryEntity() {
		return this.countryEntity;
	}

	public void setCountryEntity(CountryEntity countryEntity) {
		this.countryEntity = countryEntity;
	}

	@Column(name = "FIRST_NAME", nullable = false, length = 64)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "LAST_NAME", nullable = false, length = 128)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "EMAIL", unique = true, nullable = false, length = 128)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "PASSWORD", nullable = false, length = 1024)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "SECRET_QUESTION", nullable = false, length = 128)
	public String getSecretQuestion() {
		return this.secretQuestion;
	}

	public void setSecretQuestion(String secretQuestion) {
		this.secretQuestion = secretQuestion;
	}

	@Column(name = "SECRET_ANSWER", nullable = false, length = 1024)
	public String getSecretAnswer() {
		return this.secretAnswer;
	}

	public void setSecretAnswer(String secretAnswer) {
		this.secretAnswer = secretAnswer;
	}

	@Column(name = "MOBILE", unique = true, nullable = false, length = 48)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "SEX")
	public Boolean getSex() {
		return this.sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	@Column(name = "AGE", nullable = false)
	public int getAge() {
		return this.age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "REGISTRATION_DATE", length = 26)
	public Date getRegistrationDate() {
		return this.registrationDate;
	}

	public void setRegistrationDate(Date registrationDate) {
		this.registrationDate = registrationDate;
	}

	@Column(name = "IS_BLOCKED", nullable = false)
	public boolean getIsBlocked() {
		return this.isBlocked;
	}

	public void setIsBlocked(boolean isBlocked) {
		this.isBlocked = isBlocked;
	}

	@Column(name = "IS_DELETED", nullable = false)
	public boolean getIsDeleted() {
		return this.isDeleted;
	}

	public void setIsDeleted(boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	@Column(name = "IS_VERIFIED", nullable = false)
	public boolean getIsVerified() {
		return this.isVerified;
	}

	public void setIsVerified(boolean isVerified) {
		this.isVerified = isVerified;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<UserUuidEntity> getUserUuidEntities() {
		return this.userUuidEntities;
	}

	public void setUserUuidEntities(Set<UserUuidEntity> userUuidEntities) {
		this.userUuidEntities = userUuidEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<UserRoleEntity> getUserRoleEntities() {
		return this.userRoleEntities;
	}

	public void setUserRoleEntities(Set<UserRoleEntity> userRoleEntities) {
		this.userRoleEntities = userRoleEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<UserGroupEntity> getUserGroupEntities() {
		return this.userGroupEntities;
	}

	public void setUserGroupEntities(Set<UserGroupEntity> userGroupEntities) {
		this.userGroupEntities = userGroupEntities;
	}

	@OneToOne(mappedBy = "userEntity", cascade = { CascadeType.ALL })
	public UserVerificationEntity getUserVerificationEntity() {
		return userVerificationEntity;
	}

	public void setUserVerificationEntity(
			UserVerificationEntity userVerificationEntity) {
		this.userVerificationEntity = userVerificationEntity;
	}

}
